//测试-循环队列
//编译：g++ TestCircularQueue.cpp ../../*/*/CircularQueue.hpp ../../*/ExceptionDefinition.hpp -o test
#ifndef __TESTCIRCULARQUEUE__CPP
#define __TESTCIRCULARQUEUE__CPP

#include<iostream>
#include"../../DataStructure/Queue/CircularQueue.hpp"
#include"../../DataStructure/ExceptionDefinition.hpp"

using namespace std;
using namespace NgSiuKei;

int main(void) {
    cout << "初始化" << endl;
    CircularQueue<int> queue;
    queue.print();

    try {
        cout << "入队列：0-5五个数字" << endl;
        for(int i=0; i<5; ++i) {
            queue.push(i);
            queue.print();
        }

        cout << "依次出队列" << endl;
        while(!queue.isEmpty()) {
            queue.pop();
            queue.print();
        }

        cout << "测试clean函数" << endl;
        for(int i=0; i<5; ++i) {
            queue.push(i);
        }
        queue.print();
        queue.clear();
        queue.print();
    }
    catch(Exception &e) {
        printException(e);
    }

    return 0;
}

#endif